class ShorInputError(Exception):
    def __init__(self,length,min_length):
        self.length=length
        self.min_length=min_length

    def __str__(self):
        return f'输入的密码长度为{self.length},不能少于{self.min_length}个字符'


try:
    password=input('请输入您的密码，不少于6位')
    if len(password)<6:
        raise ShorInputError(len(password),6)
except Exception as e:
    print(e)
else:
    print(f'密码输入完成，你的密码为{password}')


